<template>
	<view class="">
		<view class="u-page">
				<u-list :height="swiperHeight">
					<u-list-item>
						<u-cell-group border="false">
							<u-cell class="cell" size="large" v-for="(item, index) in res.data" :key="index">
								  <view class="title" slot="title"><text>{{item.financeCategoryTitle}}</text></view>
								  <view class="label" slot="value">{{ formattedDate(item.date,"MM/dd") }}</view>
								  <view class="value" slot="label">{{item.explain}}</view>
							</u-cell>
						</u-cell-group>
					</u-list-item>
				</u-list>
		</view>
	</view>
</template>

<script>
	import { formatDate } from '@/common/utils/commonHelper.js'
	import listHeightMixin from '@/common/computedAltitude.js'
	export default {
		mixins:[listHeightMixin],
		data() {
			return {
				keyword: '',
				dataId:0,
				res: {},
			}
		},
		
		onLoad() {
			if(this.id!==undefined){
				this.dataId = this.id;
			}
			this.getData(this.dataId);
		},
		methods: {
			scrolltolower() {
				console.log('pages')
			},
			getData(id){
				var that = this;
				if(id===undefined){

				}else{
					that.$reqPost('StaffAchievementList',{ page:1, limit:20,staffId:id }).then(res=>{
						that.$data.res = res;
					})
				}
			},
			formattedDate(value,format){
				return formatDate(value,format);
			}
		}

	}
</script>

<style lang="scss" scoped>
	.search-box {
		padding: 20rpx;
		background-color: #fff;
	}
	.u-page{
		background-color:#fff;
	
	}
	.cell{
		.title{ font-size: 32rpx;}
		.value{ font-size: 28rpx;}
		.label{ font-size: 28rpx;}
	}
	
</style>
